<template>
  <div style="height: 100%">
    <div class="x6-html-node task_icon task_human" :class="nodeStatus" @click="click">
      <avic-node-popover
        :popover-hist-activity="popoverHistActivity"
        :popover-data="popoverData"
        :popconfirm-id="popconfirmId"
        :show-data="showData"
      >
        <div class="task_node_header" :title="showData.alias">{{ showData.alias }}</div>
        <div class="task_node_body">
          <div v-if="showData.userText" class="task_node_user">
            <avic-icon v-if="showData.dealtype === '1'" svg="avic-icon-user" class="icon_user" />
            <avic-icon v-else svg="avic-group-fill" class="icon_user" />
            {{ showData.userText }}
          </div>
          <div v-if="!showData.userText" class="task_node_user">
            <avic-icon v-if="showActors" svg="avic-icon-user" class="icon_user" />
            <span v-for="(item, index) in showActors" :key="item.id" class="user">
              <span v-if="index === 0" style="font-size: 16px" :class="'icon_' + (showData.dealtype == '1' ? 'user' : 'relation')" />
              {{ item.name }}
            </span>
          </div>
          <div class="task_node_time">{{ showData.userEndTime }}</div>
        </div>
      </avic-node-popover>
    </div>
    <span v-if="showData.userDefinedStatus == 'defined'" id="user-defined" class="user-defined-icon" />
  </div>
</template>
<script>
import AvicNodePopover from './AvicNodePopover.vue';
import nodeIconMixin from '../../../mixins/nodeIcon.js';
export default {
  name: 'Task',
  components: {
    AvicNodePopover,
    AvicIcon: () => import('@/components/icon/index.vue')
  },
  mixins: [nodeIconMixin],
  data() {
    return {
      popoverHistActivity: null,
      popoverData: [],
      popconfirmId: '' // 气泡框悬挂的父容器ID 解决层级问题
    };
  },
  mounted() {
    this.popconfirmId = this.form.popconfirmId;
  },
  methods: {}
};
</script>
<style scoped lang="less">
.task-node {
  position: static;
}
</style>
